<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script th:src="@{/jquery3.3.1.js}"></script>
<body>
<button type="button" id="sendButton">send</button>
</body>

<script type="text/javascript">

    $('#sendButton').click(function (){
        $.ajax({
            type: 'post',
            url: 'http://localhost:8080/freemarker/addUser',
            data:{
                uId:'123456',
                userName:"jack",
                address:"new york"
            },
            success:function (msg){
                console.log(msg)
            }
        });
    })


</script>
</html>